#pragma once

#include <queue>
#include <string>
#include <map>

namespace krryn{
namespace scene{
	class mesh;
	class mesh_loader;
	class mesh_queue_entry;

	class mesh_manager{
	public:
		//! register a mesh_loader
		void subscribe(mesh_loader *a_MeshLoader);

		//! queue a file for loading
		void queue(const std::string &a_Name, const std::string &a_Filename);

		//! load all files async
		void load_all();

		//! get loaded mesh by name
		mesh* get_mesh_by_name(const std::string &a_Name);
	private:
		typedef std::queue<mesh_queue_entry*> queue_t;

		std::map<std::string, mesh*> m_Done;
		std::map<std::string, mesh_loader*> m_Exts;
		queue_t m_Queue;
	};
}
}
